Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 9: Sensing Viewer Actions

../ch09/09fig07.gif
Figure 9.7

Two shapes that rotate about the Y axis when the viewer drags them.

09fig07.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
        Group {
            children [
                DEF Shape1 Transform {
                    children Shape {
                        appearance DEF White Appearance {
                            material Material { }
                        }
                        geometry Box { }
                    }
                },
                DEF Shape1Sensor CylinderSensor { }
            ]
        },
        Group {
            children [
                DEF Shape2 Transform {
                    translation 2.5 0.0 0.0
                    children Shape {
                        appearance USE White
                        geometry Cone { }
                    }
                },
                DEF Shape2Sensor CylinderSensor { }
            ]
        }
    ]
}
ROUTE Shape1Sensor.rotation_changed TO Shape1.set_rotation
ROUTE Shape2Sensor.rotation_changed TO Shape2.set_rotation